#ifndef __WIZ_DESIGNPATTERN_VISITOR_TEMPLATE_HPP__SHANHAOBO_19800429__
#define __WIZ_DESIGNPATTERN_VISITOR_TEMPLATE_HPP__SHANHAOBO_19800429__

#include "./WizDesignPatternVisitorImpl.hpp"

namespace Wiz
{
	namespace DesignPattern
	{
		namespace Visitor
		{
			template<class Param> struct Type;
		} /// end of namespace Visitor

        namespace Visitable
        {
            namespace Base
            {
                template<class VisitorT>
                struct Type : public VisitorT::tVisitableBase
                {
                    typedef VisitorT            tVisitor;
                    typedef tVisitor&           tVisitorRef;

                    Type(){}

                    template<class T>
                    static ::Wiz::Void::Type AcceptImpl(T* VAPtr, tVisitorRef VRef)
                    {
                        return VRef.Visit(*VAPtr);
                    }
                    virtual ::Wiz::Void::Type Accept(tVisitorRef VRef) = 0;
                }; /// end of struct Type
            } /// end of namespace Base

            template<class DerivedT, class VisitorT>
            struct Type : public ::Wiz::DesignPattern::Visitable::Base::Type<VisitorT>
            {
                Type() {}

                typedef ::Wiz::DesignPattern::Visitable::Base::Type<VisitorT> tSuper;

                virtual ::Wiz::Void::Type Accept(tVisitorRef VRef)
                {
                    tSuper::AcceptImpl<DerivedT>(::Wiz::Cast::Static<DerivedT*>(this), VRef);
                }
            }; /// end of struct Type
        } /// end of namespace Visitable
	} /// end of namespace DesignPattern
} /// end of namespace Wiz

#endif /*__WIZ_DESIGNPATTERN_VISITOR_TEMPLATE_HPP__SHANHAOBO_19800429__*/

#if defined(WIZ_VISITOR_PARAM_COUNT) && (WIZ_VISITOR_PARAM_COUNT >= 1) && (WIZ_VISITOR_PARAM_COUNT < 255)        

namespace Wiz
{
	namespace DesignPattern
	{
		namespace Visitor
		{
            template<class VisitableBaseT, WIZ_ENUM_PARAM_X(WIZ_VISITOR_PARAM_COUNT, class T)>
			struct Type<VisitableBaseT(WIZ_ENUM_PARAM_X(WIZ_VISITOR_PARAM_COUNT, T))> : public ::Wiz::DesignPattern::Visitor::Impl::Type<WIZ_MPP_COMBINE(WIZ_MPP_COMBINE(WIZ_TYPELIST_, WIZ_VISITOR_PARAM_COUNT), (WIZ_ENUM_PARAM_X(WIZ_VISITOR_PARAM_COUNT, T)))>
			{
                typedef VisitableBaseT    tVisitableBase;
			}; /// end of struct Type
		} /// end of namespace Visitor
	} /// end of namespace DesignPattern
} /// end of namespace Wiz

#endif /*defined(WIZ_VISITOR_PARAM_COUNT) && (WIZ_VISITOR_PARAM_COUNT >= 1) && (WIZ_VISITOR_PARAM_COUNT < 255)*/

